package com.yueya.im.business.controller;

import com.yueya.auth.utils.UserInfoUtil;
import com.yueya.common.base.BaseController;
import com.yueya.common.web.RestResult;
import com.yueya.im.dao.tables.pojos.FriendDO;
import com.yueya.im.service.FriendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("${auth.adminPath}/friend/")
public class FriendController extends BaseController {

    @Autowired
    FriendService friendService;
    @RequestMapping("list")
    public RestResult getFriends(){
        String userId = UserInfoUtil.getPrincipal().getAccount().getId();
        FriendDO friendDO = new FriendDO();
        friendDO.setMyId(Long.valueOf(userId));
        return RestResult.OkWithData(friendService.listFriend(friendDO));
    }



}
